package cn.iocoder.yudao.module.system.controller.app.patentapplication;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
import cn.iocoder.yudao.module.system.controller.admin.patentapplication.vo.PatentApplicationNewRespVO;
import cn.iocoder.yudao.module.system.service.patentapplication.PatentApplicationService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;


@Tag(name = "管理后台 - 会员专利申请")
@RestController
@RequestMapping("/member/patent-application")
@Validated
public class AppPatentApplicationController {

    @Resource
    private PatentApplicationService patentApplicationService;


    @GetMapping("/get")
    @Operation(summary = "获得会员专利申请")
    @Parameter(name = "id", description = "编号", required = true, example = "1024")
    public CommonResult<PatentApplicationNewRespVO> findPatentApplicationDetail(@RequestParam("id") Long id) {
        PatentApplicationNewRespVO patentApplicationDetail = patentApplicationService.findPatentApplicationDetail(id);
        return success(patentApplicationDetail);
    }

    @GetMapping("/page")
    @Operation(summary = "获得会员专利申请分页")
    public CommonResult<PageResult<PatentApplicationNewRespVO>> findPatentApplicationPage(@RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum,
     @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, @RequestParam(value = "caseName",required = false) String caseName){
        PageResult<PatentApplicationNewRespVO> patentApplicationPage = patentApplicationService.findPatentApplicationPage(pageNum, pageSize, caseName,null, WebFrameworkUtils.getLoginUserId());
        return success(patentApplicationPage);
    }


}